const padStart = (num: number) => {
  return num.toString().padStart(2, "0");
};

export const getTime = () => {
  const now = new Date();
  const year = now.getFullYear();
  const month = now.getMonth() + 1;
  const date = now.getDate();
  const hour = now.getHours();
  const minute = now.getMinutes();
  const time = `${year}-${padStart(month)}-${padStart(date)} ${padStart(
    hour
  )}:${padStart(minute)}`;
  return time;
};
